package com.mark.springbootvideo.controller;

import com.mark.springbootvideo.config.WeChatConfig;
import com.mark.springbootvideo.mapper.VideoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: MARK
 * @Date: 2019/9/8 09:50
 * @Version: 1.0.0
 * @Description:
 */
@RestController
@Slf4j
public class TestController {

    @Autowired
    private WeChatConfig weChatConfig;

    //测试配置读取
    @GetMapping("test_config")
    public String testConfig(){
        log.info(weChatConfig.getAppId());
        log.info(weChatConfig.getAppsecret());
        return weChatConfig.getAppId();
    }

    @Resource
    private VideoMapper videoMapper;
    @GetMapping("test_db")
    public Object testDB(){
        return videoMapper.findAll();
    }
}
